import com.alibaba.fastjson.JSONObject;
import com.youxue.service.LineDetailService;
import com.youxue.service.LineService;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Created by 15c on 2018/1/20.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring-config.xml", "classpath:spring-mybatis.xml"})
public class LineTst {
    private static final Logger LOGGER = Logger.getLogger(LineTst.class);
    @Autowired
    LineService lineService;
    @Autowired
    LineDetailService lineDetailService;
    @Test
    public void  testShowAClassAllLine(){
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>::"+ JSONObject.toJSONString(lineService.showAClassAllLine(2)));
    }
    @Test
    public void  testShowALineInfo(){
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>::"+ JSONObject.toJSONString(lineService.showALineInfo(1)));
    }
    @Test
    public void  testShowALineDetails(){
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>::"+ JSONObject.toJSONString(lineDetailService.showALineDetails(1)));
    }
    @Test
    public void  testDeleteALineDetailByLineId(){
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>::"+ JSONObject.toJSONString(lineDetailService.deleteALineDetailByLineId(6)));
    }
    @Test
    public void  testShowAClassAllLineDetailAndLine(){
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>::"+ JSONObject.toJSONString(lineService.showAClassAllLineDetailAndLine(1)));
    }
}
